<?php
/**
 * Created by PhpStorm.
 * User: C。
 * Date: 2019/8/13
 * Time: 9:04
 */
namespace app\home\controller;

use app\common\model\Config as ConfigModel;

/**
 * 寺院控制器
 * Class Company
 * @package app\home\controller
 */
class Config extends Base
{
    /**
     * [getconfig  获取配置]
     * @param
     * @return json
     * @author [C。]
     */
    public function getconfig()
    {
        $model = new ConfigModel;
        $param = input('param.');
        try{
            $config = $model->findOne(['cname'=>$param['cname']],'cvalue');
        }catch(\Exception $e){
            systembug($e->getMessage(),2,$this->url);
            return admin_json(-1, '获取失败'.$e->getMessage());
        }
        return admin_json(1, '获取成功',$config['cvalue']);
    }
    /**
     * [getMenuStatus  获取菜单显示状态]
     * @param   data 1显示 0隐藏
     * @return json
     * @author [C。]
     */
    public function getMenuStatus()
    {
        return admin_json(1, '获取成功',1);
    }
}